package com.dingding.dubbo.framework.protocol.http;

import com.dingding.dubbo.framework.Invocation;
import com.dingding.dubbo.framework.Protocol;
import com.dingding.dubbo.framework.URL;

/**
 * @program: spring-learning
 * @description:
 * @author: liugongding
 * @create: 2022-02-16 15:07
 **/
public class HttpProtocolImpl implements Protocol {

    @Override
    public void start(URL url) {
        new HttpServer().start(url.getHostname(), url.getPort());
    }

    @Override
    public String send(URL url, Invocation invocation) {
        return new HttpClient().send(url.getHostname(), url.getPort(), invocation);
    }
}
